#!/usr/bin/env ruby

require 'postgres'


def connect_db
   begin
       conn = PGconn.new("localhost", 5432, nil, nil , "CAT_STAGING", "nauman", "password")
   rescue PGError => err
       p "Exception:", err
   end
   
   return conn if conn
end

conn = connect_db
#arrIns = [%W{EntryId2 AppId2 AppOwner2 Appname2 AppMember2}]
#conn.insert_table("LDAP_Raw", arrIns)
res = conn.exec(%q{select * from "LDAP_Raw"}).each { |row| print row, "t" }
conn.close





